package il.ac.bgu.soa2009.hw6.cinema.impl;

import il.ac.bgu.soa2009.hw6.cinema.*;

import java.util.Date;

import org.apache.axis.AxisFault;

/**
 * User: Henry
 * Date: 04/04/2009
 * Time: 03:49:26
 */
public class TestImpl {
    public static void main(String[] args) {
        Cinema instance = CinemaSingleton.getInstance();
        try {
            TicketRequest ticketOrder = new TicketRequest("Movie0", new Date(), 2);
            Ticket ticket;// = instance.orderTickets(ticketOrder);

            instance.setHallsNumber(2);

            ticket = instance.orderTickets(ticketOrder);

            Hall[] halls = new Hall[2];
            halls[0] = new Hall(0, 2);
            halls[1] = new Hall(1, 1);
            instance.setHallSeats(halls);

            //ticket = instance.orderTickets(ticketOrder);

            MovieInHall movieInHall = new MovieInHall(new Movie("Movie0", 108, "sdfsdf"), 0);
            instance.setMovie(movieInHall);
            ticket = instance.orderTickets(ticketOrder);
            MovieInHall movieInHall1 = new MovieInHall(new Movie("Movie1", 16, "sdfsdf"), 1);
            instance.setMovie(movieInHall1);

            TicketIdentifier id = ticket.getId();
            id.setReservationId(234);
            instance.cancelTickets(id);

            ticket = instance.orderTickets(ticketOrder);
            int i=0;
        } catch (CinemaException e) {
            e.printStackTrace(); 
        }
    }
}
